// KeyboardStatus.h
//
#ifndef KEYBOARDSTATUS_ONCE
#define KEYBOARDSTATUS_ONCE

#include <QKeySequence>

#include <string>


class QKeyEvent;
//class QKeySequence;

namespace QtFwk {

class KeyboardStatus
{
private:
	//bool buffer[256];
	int  modifiers;

	QKeySequence keySequence;

	//
	enum Modifier
	{
		ModifierNone  = 0x0000, // No modifier
		ModifierShift = 0x0100, // Shift key pressed
		ModifierCtrl  = 0x0200, // Ctrl key pressed
		ModifierAlt   = 0x0400, // Alt key pressed
		ModifierMeta  = 0x0800, // Meta key pressed
		ModifierAny   = 0x0F00, // Mask to get modifiers only
	};

	//void __addOrAppend( const std::string &src, std::string &dst )const;
	//std::string getKeyAsString(int k) const;


public:
	KeyboardStatus();
	~KeyboardStatus();

	// -----------------------------------------------------------------------------------------------
	void reset() ;
	void update( QKeyEvent *e, bool pressed );
	//std::string toString() const;

	unsigned int getCode() const;
};



}


#endif